﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ecopsy.DataTier;
using Ecopsy.DataTier.SqlLibrary;
using AgencyEntityLib.Context;

namespace AgencyEntityLib.BaseEntity
{
    /// <summary>
    /// Департамент/подразделение 
    /// </summary>
    public class Department : TreeEntitySingle
    {
        private string _Name = string.Empty;
        public string Name { get { return _Name; } set { _Name = value; } }

        // Настройки 
        private DepartmentSettings _Settings = new DepartmentSettings () ;
        public DepartmentSettings Settings { get { return _Settings; } }

       
        public List<Employeer> GetEmployeers()
        {
            wsFace ws = (wsFace)AgencyLib_GlobalConstants.CurrentAgency.WS_FactoryList[WS_FactoryList.wsKey_Face] ;
            EmployeeList.sqlLoadStatment w = new EmployeeList.sqlLoadStatment();
            w.ParamValueList_SearchOption = vPropertyOfList.Options.Value;
            w.ParamValueList.Clear();
            w.ParamValueList.Add(new vPropertyOfList.ParamListItem() { Param = string.Empty, Value = ID });
            EmployeeList l = ws.GetEmplList(w);
            return l.ToList<Employeer>();
        }
    }
}
